<template>
<el-table :data="contactList" border>
    <el-table-column label="类型" prop="tag" align="center" width="120">
    </el-table-column>
    <el-table-column label="联系方式" prop="contact"></el-table-column>
</el-table>
</template>

<script>
export default {
    name: "ContactList",
    props: {
        contactList: {
            type: Array,
            default: []
        }
    },
    methods: {
        // 移除联系方式
        removeContact(index) {
            this.$confirm('确认删除此联系方式', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.contactList.splice(index, 1);
                this.$message({
                    type: 'success',
                    message: '删除成功!'
                });
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });

        },
    }
}
</script>

<style>

</style>
